//
//  BSKNoteType.m
//  MicroMemory
//
//  Created by rimi on 16/7/16.
//  Copyright © 2016年 BlueSky. All rights reserved.
//

#import "BSKNoteType.h"
#import <AVOSCloud/AVOSCloud.h>
@interface BSKNoteType ()
@property(nonatomic,strong) UIImage * picture;
@end

@implementation BSKNoteType
- (instancetype)init
{
	self = [super init];
	if (self) {
		_secretMode = NO;
		_typeName = @"没有数据";
		_typeID = 0;
		_userID = @"null";
		AVUser * user = [AVUser currentUser];
		if (user) {
			_userID = user.objectId;
		}
		_pictureFileName = @"localHost://paper1";
		_secretMode = NO;
        _objectID = @"null";
		_password = @"";
	}
	return self;
}
+ (instancetype)typeWithResultSet:(FMResultSet *)resultSet {
    BSKNoteType *noteType = [[BSKNoteType alloc] init];
    noteType.secretMode = [resultSet boolForColumn:@"secretMode"];
    noteType.objectID = [resultSet stringForColumn:@"objectID"];
    noteType.typeID = [resultSet stringForColumn:@"typeID"];
    noteType.userID = [resultSet stringForColumn:@"userID"];
    noteType.typeName = [resultSet stringForColumn:@"typeName"];
    noteType.pictureFileName = [resultSet stringForColumn:@"pictureFileName"];
    noteType.password = [resultSet stringForColumn:@"password"];
	noteType.updateTime = [resultSet doubleForColumn:@"updateTime"];
    return noteType;
}
-(NSString *)description{
		return [NSString stringWithFormat:@"<BSKNoteType secretMode:%@, objectID:%@, typeID:%@, userID:%@, typeName:%@, pictureFileName:%@, password:%@, updateTime:%lf >",self.secretMode?@"YES":@"NO",self.objectID,self.typeID,self.userID,self.typeName,self.pictureFileName,self.password,self.updateTime];
}

@end
